package com.example.chatspringboot.controller;

import com.example.chatspringboot.common.vo.Result;
import com.example.chatspringboot.entity.User;
import com.example.chatspringboot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserMapper userMapper;

    @GetMapping("/all")
    public Result<List<User>> getAllUser(){
        List<User> userList = userMapper.selectList(null,null);
        return Result.success(userList,"查询成功");
    }
}
